package com.younio.local.controller;

import com.younio.local.service.JbService2;
import com.younio.local.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/jb")
public class JbController {

    //    @Autowired
//    private JbService jbService;
    @Autowired
    private JbService2 jbService;

    @PostMapping("/result/db")
    public Object resultDb(@RequestBody com.younio.local.entity.Line2.Line line) {
        log.info("====================================================================================================");
        log.info("Received param 'line': " + line);
        log.info("====================================================================================================");
        return jbService.addTask(line);
    }

    @PutMapping("/result/cancel")
    public Object resultDb(@RequestParam String uuid) {
        jbService.remove(uuid);
//        jbService.dispatch(line);
        return Result.OK();
    }


}
